LIBDIR = ../lib

#CC = gcc
CC = g++
CFLAGS = -g -Wall

.c.o:
	$(CC) $(CFLAGS) -c $<

.cc.o:
	$(CXX) $(CFLAGS) -c $<

HEADERS = d_Math.h d_Vec2f.h d_Vec3f.h d_Vec4f.h d_Mat4f.h d_Plane.h d_Camera.h d_Light.h d_AABB.h d_NormalCone.h d_Frustum.h

SOURCES = d_Math.cc d_Vec2f.cc d_Vec3f.cc d_Vec4f.cc d_Mat4f.cc d_Plane.cc d_Camera.cc d_Light.cc d_AABB.cc d_NormalCone.cc d_Frustum.cc

OBJECTS = d_Math.o d_Vec2f.o d_Vec3f.o d_Vec4f.o d_Mat4f.o d_Plane.o d_Camera.o d_Light.o d_AABB.o d_NormalCone.o d_Frustum.o

LIBNAME = libd_Lib.a

$(LIBNAME): $(HEADERS) $(OBJECTS)
	ar ruv $(LIBNAME) $(OBJECTS)
	ranlib $(LIBNAME)

$(OBJECTS):  $(HEADERS)

install: $(LIBNAME)
	mv $(LIBNAME) $(LIBDIR)

clean:
	rm -f *.o *~ $(LIBNAME)

